package com.wanxi.dangdang.mapper;

import com.wanxi.dangdang.model.pojo.Area;
import com.wanxi.dangdang.model.pojo.Scenic;
import com.wanxi.dangdang.model.vo.AddScenicVO;
import com.wanxi.dangdang.model.vo.BUserScenicVO;
import com.wanxi.dangdang.model.vo.FindPageScenicVO;
import com.wanxi.dangdang.model.vo.PageScenicDimVO;
import com.wanxi.dangdang.model.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.List;

/**
 * @Author: yanguangqiong
 * @Description:
 * @Date: Created in 2021/8/31
 * @Version: 1.0
 */
@Component
public interface ScenicMapper {

    List<Scenic> esFindAll();

    ScenicFindByIdVO findById(Long id);

    List<ScenicPageVO> findPage(PageScenicDimVO pageScenicDimVO);

    void add(AddScenicVO addScenicVO,String scenicNumber);

    AddScenicVO backFindById(Long scenicId);

    void delete(Long scenicId);

    void backUpdateStatus(Long scenicId);

    List<Scenic> backFindPage(FindPageScenicVO findPageScenicVO);

    List<BUserScenicVO> findByDistributorId(PageScenicDimVO pageScenicDimVO);

    void updateStatus(Long distributorId, Long scenicId);

    void deleteScenicByBUser(@Param("distributorId") Long distributorId, @Param("scenicId") Long scenicId);

    List<HighSalesCityVO> findHighSalesCityBySales();

    List<SumScenicVO> findHighSumScienceByCity();

    Integer saveToMyStore(Long distributorId, Long scenicId);

    List<ScenicPageVO> PlatformRecommend();

    void backUpdate(AddScenicVO addScenicVO,Long id);
    Integer increaseSale(Long scenicId, Integer num);

    Area findAreaInfoByDistrictId(Long districtId);

    Long findDistrictIdByArea(Area area);

    Integer findRepertory(@Param("scenic_id") Long scenicId,@Param("parse") String parse);
//在表中添加记录
    void addRepertory(@Param("scenic_id") Long scenicId, @Param("repertory") Integer repertory, @Param("timeStamp") Timestamp timeStamp);

    Integer decreaseRepertory(@Param("scenicId") Long scenicId, @Param("time") String time, @Param("decreaseRepertory")Integer updateRepertory);
    Integer increaseRepertory(@Param("scenicId") Long scenicId, @Param("time") String time, @Param("updateRepertory")Integer updateRepertory);

    Double findCommissionRateByScenicId(Long id);

    List<ScenicIdVO> findRepetitionStore(Long id, Long scenicId);

    Long findStoreIdByUserid(Long distributorId);
}
